# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=ffsend
pkgver=0.2.65
pkgrel=0
pkgdesc="A fully featured Firefox Send client"
url="https://gitlab.com/timvisee/ffsend"
arch="all !mips !mips64 !ppc64le !s390x" # limited by cargo, ring dep
license="GPL-3.0-only"
makedepends="cargo openssl-dev"
subpackages="
	$pkgname-zsh-completion
	$pkgname-fish-completion
	$pkgname-bash-completion
	"
source="https://gitlab.com/timvisee/ffsend/-/archive/v$pkgver/ffsend-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	cargo build --release
}

check() {
	cargo test --release
}

package() {
	cargo install --path . --root="$pkgdir/usr"
	rm "$pkgdir"/usr/.crates.toml

	install -Dm644 "$builddir"/contrib/completions/ffsend.bash \
			"$pkgdir"/usr/share/bash-completion/completions/ffsend
	install -Dm644 "$builddir"/contrib/completions/_ffsend \
			"$pkgdir"/usr/share/zsh/site-functions/_ffsend
	install -Dm644 "$builddir"/contrib/completions/ffsend.fish \
			"$pkgdir"/usr/share/fish/completions/ffsend.fish
}

sha512sums="b17e9bfecefccff82b02d90e583d4296239bb8cecb379d47ee09411ed2e6d2214197654a0f738ae5d966c6e9826070f765a318304797db128ad7cdea95943a2e  ffsend-v0.2.65.tar.gz"
